using UnityEngine;
using System.Collections;

public class HighScore : MonoBehaviour {

	// Use this for initialization
	void Start () {
	
		
	}
	
	// Update is called once per frame
	void Update () {
	
	}
	
	void OnGUI()
    {
     	GUI.Box(new Rect( 50, 50, Screen.width - 100, Screen.height - 100),"High Scores");
		
		;
		for( int i = 0; i < 10; i ++)
		{
			
			int score = PlayerPrefs.GetInt("Scores"+i, 0);
			string name = PlayerPrefs.GetString("Names"+i, "No Name");
			GUI.Label(new Rect( 100, 100 + (i * 25), Screen.width/2 - 100, 25), (i + 1) + ". " + name);
			GUI.Label(new Rect( Screen.width/2 , 100 + (i * 25), Screen.width/2 - 100, 25), "" + score);
			          
		}
		
		if(GUI.Button(new Rect( 300, Screen.height - 110, Screen.width - 600, 50), "Main Menu"))
		{
			Application.LoadLevel("MainMenu");
		}
	}
	
	
}
